<?php

namespace App\Models\Train\Stations\Repositories\Interfaces;

use App\Models\Train\Stations\TrainStation;
use Illuminate\Support\Collection;

interface StationRepositoryInterface
{
    /**
     * 新增站点
     * @param array $data
     * @param bool  $update
     * @return TrainStation
     */
    public function addStation(array $data, bool $update = false): TrainStation;


    public function findOneByCode(string $station_code, bool $isThrow = false): ?TrainStation;

    public function findOneByName(string $station_name, bool $isThrow = false): ?TrainStation;

    public function updateStation(TrainStation $station, array $data): bool;

    /**
     * 站点列表
     * @return Collection
     */
    public function listStations(): Collection;

    public function listBy(array $condition = []): Collection;

    /**
     * 站点的车次有哪些
     * @param $station_code
     * @return Collection
     */
    public function listStationNumbers($station_code): Collection;

    /**
     * 热门站点
     * @param int $limit
     * @return Collection
     */
    public function listHotStations(int $limit = 6): Collection;

    /**
     * 热门城市
     * @param int $limit
     * @return Collection
     */
    public function listHotCities(int $limit = 6): Collection;

    public function addOrUpdateStations(array $stations);
}